import React, { Component } from 'react'
import { Layout} from 'antd';

import './index.css'
import TraSider from '../../containers/TraSider';
import TraContent from '../../containers/TraContent';
import TraHeader from '../../containers/TraHeader';

export default class Main extends Component {

    handleMenuSelect = (menu) => {
        let path = menu?.path
        if (!path || path === '') {
            return;
        }
        const route = '/main/' + menu.path;
        console.log('toPath', route)
        this.props.history.push(route)
    }

    render() {
        console.log('Main...', this)
        return (
            <Layout className="main-layout">
                <TraSider onSelect={this.handleMenuSelect} {...this.props}></TraSider>
                <Layout>
                    <TraHeader />
                    <TraContent {...this.props}/>
                </Layout>
            </Layout>
        )
    }
}